using System;
using System.Runtime.Serialization;

namespace PSE.Hosting.ServiceHoster.Services.FaultContracts
{
    [DataContractAttribute(Namespace = "http://www.bovespa.com.br/ServiceHoster.Fault", Name = "DefaultFaultContract")]
    public class DefaultFaultContract
    {
        #region Fields

        private int _errorId;
        private string _errorMessage;
        private Guid _correlationId;

        #endregion

        #region Constructors

        /// <summary>
        /// 
        /// </summary>
        public DefaultFaultContract()
            : this(-1, String.Empty, Guid.Empty)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="errorId"></param>
        /// <param name="errorMessage"></param>
        /// <param name="correlationId"></param>
        public DefaultFaultContract(int errorId, string errorMessage, Guid correlationId)
        {
            this._errorId = errorId;
            this._errorMessage = errorMessage;
            this._correlationId = correlationId;
        }

        #endregion

        #region Public Members

        /// <summary>
        /// 
        /// </summary>
        [DataMemberAttribute(IsRequired = true, Name = "ErrorId", Order = 1)]
        public int ErrorId
        {
            get { return _errorId; }
            set { _errorId = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [DataMemberAttribute(IsRequired = true, Name = "ErrorMessage", Order = 2)]
        public string ErrorMessage
        {
            get { return _errorMessage; }
            set { _errorMessage = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [DataMemberAttribute(IsRequired = true, Name = "CorrelationId", Order = 3)]
        public Guid CorrelationId
        {
            get { return _correlationId; }
            set { _correlationId = value; }
        }

        #endregion
    }
}